﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DBUtility;

namespace TTSDAL
{
    public class T0001996_SummaryReport
    {

        private const string PARM_StartSN = "@StartSN";
        private const string PARM_EndSN = "@EndSN";
        private const string PARM_TestType = "@TestType";
        public DataSet GetSummaryDataSet(string datatablename, string _startSN, string _endSN,string _productType )
        {
            SqlParameter[] parms = GetParameters();          
            parms[0].Value = _startSN;
            parms[1].Value = _endSN; 
            parms[2].Value = _productType;
            return sqlHelper.GetDataSet("T0001996_TestSummaryReport", datatablename, sqlHelper.ConnectionStringLocalTransaction, parms);
        }


        public DataSet GetFirstTestDataSet(string datatablename, string _startSN, string _endSN)
        {
            SqlParameter[] parms = GetFParameters();
            parms[0].Value = _startSN;
            parms[1].Value = _endSN; 
            return sqlHelper.GetDataSet("T0001996_FirstTest", datatablename, sqlHelper.ConnectionStringLocalTransaction, parms);
        }



        public SqlParameter[] GetFParameters()
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter(PARM_StartSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_EndSN, SqlDbType.NVarChar, 10) 
            };
            return parms;
        }


        public SqlParameter[] GetParameters()
        {
            SqlParameter[] parms = new SqlParameter[]
            {
                new SqlParameter(PARM_StartSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_EndSN, SqlDbType.NVarChar, 10),
                new SqlParameter(PARM_TestType, SqlDbType.NVarChar, 10), 
            };
            return parms;
        }
    }
}
